## DB SETUP ##
mongoose = require 'mongoose'
dbConnection = mongoose.connection

dbConnection.on 'error', console.error

dbConnection.once 'open', () ->
    mongoose.model 'User', new mongoose.Schema({
        username: String,
        email: String,
        password: String,
        lastLogin: Date
    }), 'user'
    
    return

mongoose.connect 'mongodb://localhost/nmdb'
module.exports = mongoose